<?php

	class Bether {

		public function say()
		{

		}

	}
	
	
	Class User {

		// user_id
		protected $id;

		// 用户名
		protected $userName;

		/**nickname**/
		protected $nickname;

		//protected $behavior = null;

		public function __construct($name,Bether $behavior,$nickname = "xiao bei")
		{
			//$this->behavior = $behavior;
		}

		// 获取用户ID
		public function getId()
		{
			return $this->id;
		}

		// 获取用户名
		public function getUserName()
		{
			return $this->userName;
		}

		// 设置用户名
		public function setUserName($name)
		{
			return $this->userName = $name;
		}

		// public function sayUser()
		// {
		// 	return $this->behavior->say();
		// }

	}


	try {

		$reflerctor = new \ReflectionClass("User");

		$constructors = $reflerctor->getConstructor()->getParameters();

		$dependencies = [];
		$classTest = [];
		foreach ($constructors as $params) {
			if ($params->isDefaultValueAvailable()) {
				$dependencies[] = $params->getDefaultValue();
			} else {
				$dependClass = $params->getClass();
				$isClass = !is_null($dependClass) ? true : false;
				$classTest[] = $isClass ? $dependClass->getName() : null; 
			}




		}

		var_dump($classTest);die;


		//var_dump($reflerctor->getConstructor()->getParameters());die;


	} catch(\Exception $e) {

		var_dump($e->getMessage());die;

	}

	
?>